package sk.xorty.flow.splitters;

import org.springframework.integration.Message;
import org.springframework.integration.annotation.Splitter;
import org.springframework.stereotype.Component;
import sk.xorty.domain.MixedContent;

import java.util.ArrayList;
import java.util.List;

@Component
public class MixedContentSplitter {

    @Splitter
    public List<Object> split(Message<MixedContent> message) {
        List<Object> splitted = new ArrayList<>();

        splitted.add(message.getPayload().getAccount());
        splitted.add(message.getPayload().getTrade());

        return splitted;
    }

}
